<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/resources/jstl_contexpath.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title>虎丘婚纱城管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bs3/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/bootstrap-reset.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/font-awesome/css/font-awesome.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/clndr.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style-responsive.css" />" />

    <!-- start: CSS -->
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/style.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/retina.min.css" />" />
    <!-- end: CSS -->

    <!-- start: Favicon and Touch Icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<c:url value="/resources/assets/ico/apple-touch-icon-144-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<c:url value="/resources/assets/ico/apple-touch-icon-114-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<c:url value="/resources/assets/ico/apple-touch-icon-72-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="<c:url value="/resources/assets/ico/apple-touch-icon-57-precomposed.png" />" />
    <link rel="shortcut icon" href="<c:url value="/resources/assets/ico/favicon.png" />" />
    <!-- end: Favicon and Touch Icons -->


</head>
<body>

<!-- start: Header -->
<%@ include file="/resources/head.jsp" %>
<!-- end: Header -->

<div class="container">
    <div class="row">
        <!-- start: Main Menu -->
        <%@ include file="/resources/sidebar.jsp" %>
        <!-- end: Main Menu -->

        <!-- start: Content -->
        <div id="content" class="col-lg-10 col-sm-11" style="min-height: 2500">
            <div class="form-top">
                <div class="form-group">
                    <button type="button" class="btn btn-primary" id="modify" value="${activity_info.id}">
                        <i class="icon-base icon-24 icon-btn-add"></i>
                        <span class="btn-icon-text">编辑</span>
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;
                    <c:if test="${activity_info.status == 1}">
                    <button type="button" class="btn btn-danger" id="downline" value="${activity_info.id}">
                        <i class="icon-base icon-24 icon-btn-templateload"></i>
                        <span class="btn-icon-text">下线</span>
                    </button>
                    </c:if>
                    <c:if test="${activity_info.status == 0}">
                    <button type="button" class="btn btn-danger" id="upline" value="${activity_info.id}">
                        <i class="icon-base icon-24 icon-btn-templateload"></i>
                        <span class="btn-icon-text">上线</span>
                    </button>
                    </c:if>

                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header">
                            <h2><i class="fa fa-align-justify"></i><span class="break"></span>活动详情</h2>
                            <div class="box-icon">
                            </div>
                        </div>
                        <div class="box-content">
                            <table class="table-base table table-bordered">
                                <tr>
                                    <td width="15%"> 活动名称</td>
                                    <td> ${activity_info.name}</td>
                                </tr>
                                <tr>
                                    <td> 活动类型</td>
                                    <td> 报名活动</td>
                                </tr>
                                <tr>
                                    <td> 开始时间</td>
                                    <td> ${activity_info.begin_time}</td>
                                </tr>
                                <tr>
                                    <td> 结束时间</td>
                                    <td> ${activity_info.end_time}</td>
                                </tr>
                                <tr>
                                    <td> 创建时间</td>
                                    <td> ${activity_info.create_at}</td>
                                </tr>
                                <tr>
                                    <td> 活动描述</td>
                                    <td> ${activity_info.description}</td>
                                </tr>
                                <tr>
                                    <td> 报名数量</td>
                                    <td> ${activity_info.signup_count}</td>
                                </tr>
                                <tr>
                                    <td> 现场签到二维码</td>
                                    <td>
                                        <img src="${ctx}/${activity_info.sign_qr_code}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td> 投放渠道</td>
                                    <td>
                                        <table border="1">
                                            <tr>
                                                <td>渠道名称</td>
                                                <td>点击数</td>
                                                <td>报名数</td>
                                                <td>平均报名成本</td>
                                                <td>平均点击成本</td>
                                                <td>活动url地址</td>
                                                <td>二维码</td>
                                            </tr>
                                            <c:forEach var="activity_channel_detail" items="${activity_channel_detail_list}" varStatus="status">
                                            <tr>
                                                <td>${activity_channel_detail.channel_name}</td>
                                                <td>${activity_channel_detail.point_count}</td>
                                                <td>${activity_channel_detail.signup_count}</td>
                                                <td>${activity_channel_detail.signup_cost_avg}</td>
                                                <td>${activity_channel_detail.point_cost_avg}</td>
                                                <td>${baseurl}/hqhsc/activity/signup/normal?aid=${activity_channel_detail.activity_id}&cid=${activity_channel_detail.channel_id}</td>
                                                <td>
                                                    <img src="${ctx}/${activity_channel_detail.qr_code}" alt="${activity_channel_detail.channel_name}">
                                                </td>
                                            </tr>
                                            </c:forEach>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div><!--/col-->
            </div>
        </div>
    </div>
</div>
<%@ include file="/resources/managerfoot.jsp"%>

<!-- start: JavaScript-->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-2.1.0.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-migrate-1.2.1.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/bootstrap.min.js" />" ></script>

<!-- page scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-ui-1.10.3.custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.sparkline.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.dataTables.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/dataTables.bootstrap.min.js" />" ></script>

<!-- theme scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/core.min.js" />" ></script>

<!-- inline scripts related to this page -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/pages/table.js" />" ></script>

<!-- end: JavaScript-->

<script>
    $(function () {
        $('#downline').click(function(){
            if(confirm("确定要将活动下线吗？")) {
                var activity_id = $(this).val();
                window.location.href="${ctx}/manage/activity/downline?aid="+activity_id;
            }
        })
        $('#upline').click(function(){
            if(confirm("确定要将活动上线吗？")) {
                var activity_id = $(this).val();
                window.location.href="${ctx}/manage/activity/upline?aid="+activity_id;
            }
        })
        $('#modify').click(function(){
            var activity_id = $(this).val();
            window.location.href="${ctx}/manage/activity/edit?aid="+activity_id;
        })
    });
</script>
</body>
</html>